﻿using Stardust.Common.Enum;
using Stardust.ConfigCenterWeb.Code.Entities;
using Stardust.ConfigCenterWeb.Code.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Stardust.ConfigCenterWeb.Controllers
{
    public class ServiceNodeController : Controller
    {
        // GET: ServiceNode
        public ActionResult Index(string serviceName, string address, string version, ServerNodeStatus? status)
        {
            var list = ServerNodeService.Instance.SearchList(serviceName, address, version, status);
            return View(list);
        }


        public ActionResult EditAsync(ServerNode model)
        {
            ServerNodeService.Instance.Edit(model);
            return new EmptyResult();
        }

        public ActionResult DeleteAsync(long nodeId, string serviceName)
        {
            ServerNodeService.Instance.Delete(nodeId, serviceName);
            return new EmptyResult();
        }

    }
}